package leetcode.code1688;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public class Solution implements IDebug {

	public int numberOfMatches(int n) {
		int ans = 0;
		while (n > 1) {
			ans += n >> 1;
			n = (n & 1) + n >> 1;
		}
		return ans;
	}

	@Override
	public void debug1() {
		HelpDebug.compare(13, this.numberOfMatches(14));

	}

	@Override
	public void debug2() {
		HelpDebug.compare(6, this.numberOfMatches(7));

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		Solution so = new Solution();
		so.debug1();
		so.debug2();
		so.debug3();
		so.debug4();

	}

}
